package com.ruyuan2020.im.design.mementopattern.nouse;

public class Client {
    public static void main(String[] args) {
        TextDocument document = new TextDocument();
        System.out.println("初始内容: " + document.getContent());

        document.setContent("第一次编辑");
        System.out.println("编辑后内容: " + document.getContent());

        document.undo();
        System.out.println("撤销后内容: " + document.getContent());

        // 尝试再次撤销，将会回到初始状态
        document.undo();
        System.out.println("再次撤销后内容: " + document.getContent());

        // 再次尝试撤销，内容应保持不变
        document.undo();
        System.out.println("无法再撤销，内容保持为: " + document.getContent());
    }
}
